<!doctype html>
<html lang="en">

<head>
    <meta charset="utf-8" />
    <title>档口信息管理</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <!-- App favicon -->
    <link rel="shortcut icon" href="assets/istallsPictureses/favicon.ico">

    <!-- App css -->
    <link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="assets/css/icons.css" rel="stylesheet" type="text/css" />
    <link href="assets/css/metismenu.min.css" rel="stylesheet" type="text/css" />
    <link href="assets/css/style.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="assets/css/custom.css" />
    <!-- layer插件 -->
    <link rel="stylesheet" type="text/css" href="plugins/layer2.4/skin/layer.css" />

    <!-- bootstrap-select -->
    <link rel="stylesheet" type="text/css" href="plugins/bootstrap-select/css/bootstrap-select.min.css" />

    <script src="assets/js/modernizr.min.js"></script>

</head>

<body>

    <!-- Begin page -->
    <div id="wrapper">

        <!-- ============================================================== -->
        <!-- 页面内容开始 -->
        <!-- ============================================================== -->

        <!-- Start Page content -->
        <div class="my-content">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-md-12">
                        <div class="card-box">
                            <h4 class="m-t-0 m-b-30 header-title">档口信息</h4>

                            <form class="form-horizontal" role="form">
                                <!-- <div class="form-group row">
                                    <label for="id" class="col-3 col-form-label">档口ID</label>
                                    <div class="col-9">
                                        <input type="text" class="form-control" id="id" name="id" placeholder="档口ID"
                                            readonly="readonly">
                                    </div>
                                </div> -->
                                <div class="form-group row">
                                    <label for="id" class="col-3 col-form-label">档口编号</label>
                                    <div class="col-9">
                                        <input type="text" class="form-control" id="number" name="number"
                                            placeholder="档口编号" readonly="readonly">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label for="houseName" class="col-3 col-form-label">所属的市场</label>
                                    <div class="col-9">
                                        <input type="text" class="form-control" id="houseName" name="houseName"
                                        placeholder="所属的市场" readonly="readonly">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label for="userId" class="col-3 col-form-label">档口负责人</label>
                                    <div class="col-9">
                                        <input type="text" class="form-control" id="userId" name="userId"
                                            placeholder="档口负责人" readonly="readonly">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label for="phone" class="col-3 col-form-label">负责人联系方式</label>
                                    <div class="col-9">
                                        <input type="text" class="form-control" id="phone" name="phone"
                                            placeholder="负责人联系方式" readonly="readonly">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label for="userQq" class="col-3 col-form-label">负责人QQ</label>
                                    <div class="col-9">
                                        <input type="text" class="form-control" id="userQq" name="userQq"
                                            placeholder="负责人QQ" readonly="readonly">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label for="userWechat" class="col-3 col-form-label">负责人微信</label>
                                    <div class="col-9">
                                        <input type="text" class="form-control" id="userWechat" name="userWechat"
                                            placeholder="负责人微信" readonly="readonly">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label for="file" class="col-3 col-form-label">负责人二维码</label>
                                    <div class="col-9">
                                        <istallsPicturese src="" class="userWechatCode" mode="widthFix" style="max-width: 504px;" />
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label for="createBy" class="col-3 col-form-label">创建者</label>
                                    <div class="col-9">
                                        <input type="text" class="form-control" id="createBy" name="createBy"
                                            placeholder="创建者" readonly="readonly">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label for="file" class="col-3 col-form-label">图片</label>
                                    <div class="col-9">
                                        <istallsPicturese src="" class="stallsPictures" mode="widthFix" style="max-width: 504px;" />
                                    </div>
                                </div>

                                <div class="form-group mb-0 justify-content-end row">
                                    <div class="col-9">
                                        <button type="button" onclick="layer_close()"
                                            class="btn btn-danger waves-effect">关闭</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>

            </div>
            <!-- container -->

        </div>

        <!-- ============================================================== -->
        <!-- End Right content here -->
        <!-- ============================================================== -->

    </div>
    <!-- END wrapper -->

    <!-- jQuery  -->
    <script src="assets/js/jquery.min.js"></script>
    <script src="assets/js/bootstrap.bundle.min.js"></script>
    <script src="assets/js/metisMenu.min.js"></script>
    <script src="assets/js/waves.js"></script>
    <script src="assets/js/jquery.slimscroll.js"></script>

    <!-- App js -->
    <script src="assets/js/custom.js" type="text/javascript" charset="utf-8"></script>
    <script src="assets/js/jquery.core.js"></script>
    <script src="assets/js/jquery.app.js"></script>
    <script src="assets/js/custom.js" type="text/javascript" charset="utf-8"></script>

    <!-- 表单验证 -->
    <script src="plugins/jquery.form.js/jquery.form.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="plugins/jquery.validation.1.14.0/jquery.validate.js" type="text/javascript" charset="utf-8"></script>
    <script src="plugins/jquery.validation.1.14.0/validate-methods.js" type="text/javascript" charset="utf-8"></script>
    <script src="plugins/jquery.validation.1.14.0/messages_zh.js" type="text/javascript" charset="utf-8"></script>
    <!-- bootstrap-select -->
    <script src="plugins/bootstrap-select/js/bootstrap-select.js" type="text/javascript" charset="utf-8"></script>

    <!-- layer插件 -->
    <script src="plugins/layer2.4/layer.js" type="text/javascript" charset="utf-8"></script>

    <!-- easyUI -->
    <script src="plugins/jquery-easyUI/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="plugins/jquery-easyUI/easyui-lang-zh_CN.js" type="text/javascript" charset="utf-8"></script>

    <!-- datatables插件 -->
    <script type="text/javascript">
        $(function () {
           //获取用户列表
            $.ajax({
                type: "post",
                url: URL + 'findUserAll',
                async: false,
                dataType: "json",
                success: function (data) {
                    for (var i = 0; i < data.length; i++) {
                        var options = $('<option value="' + data[i].personId + '">' + data[i].username + '    [id=' + data[i].personId + ']' + '</option>')
                        $("#userName").append(options);
                    }
                    $('.selectpicker').selectpicker('refresh');
                    $('.selectpicker').selectpicker('render');
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    networkError(XMLHttpRequest, textStatus, errorThrown)
                }
            });
            //获取负责人联系方式列表
            $.ajax({
                type: "post",
                url: URL + 'findUserAll',
                async: false,
                dataType: "json",
                success: function (data) {
                    for (var i = 0; i < data.length; i++) {
                        var options = $('<option value="' + data[i].personId + '">' + data[i].username + '    [id=' + data[i].personId + ']' + '</option>')
                        $("#phone").append(options);
                    }
                    $('.selectpicker').selectpicker('refresh');
                    $('.selectpicker').selectpicker('render');
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    networkError(XMLHttpRequest, textStatus, errorThrown)
                }
            });





        code = get_code()
        //把参数回填
        $.ajax({
            type: "get",
            url: URL + 'stalls/id?id=' + code,
            async: false,
            dataType: "json",
            success: function (data) {
                data = data.object
                console.log(data)
                if (!data.stallsPictures) {
                    $('.stallsPictures').parent().parent().addClass('hidden')
                } else {
                    $('.stallsPictures').parent().parent().removeClass('hidden')
                    URL = URL.slice(0, URL.length - 1)
                    data.stallsPictures = URL + data.stallsPictures
                    $('.stallsPictures')[0].setAttribute('src', data.stallsPictures)
                }
                if (!data.userWechatCode) {
                    $('.userWechatCode').parent().parent().addClass('hidden')
                } else {
                    $('.userWechatCode').parent().parent().removeClass('hidden')
                    URL = URL.slice(0, URL.length - 1)
                    data.userWechatCode = URL + data.userWechatCode
                    $('.userWechatCode')[0].setAttribute('src', data.userWechatCode)
                }
                $("form").form('load', data);
                $('.selectpicker').selectpicker('val', data.slaughterHouseId);
                $('.selectpicker').selectpicker('val', data.userName);
                $('.selectpicker').selectpicker('val', data.phone);
                $('.selectpicker').selectpicker('refresh');
                $('.selectpicker').selectpicker('render');
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                networkError(XMLHttpRequest, textStatus, errorThrown)
            }
        });
        });
    </script>

</body>

</html>